package com.young.shop_admin.controller;

import com.young.shop_admin.pojo.vo.ManagementCenterDataVO;


import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;


@WebServlet("/managementCenter")
public class ManagementCenterController extends BaseController {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //跨域
        resp.setHeader("Access-Control-Allow-Origin","http://localhost:63342");
        //获取数据库信息
        ManagementCenterDataVO initData = centerData.getInitData();
        try {
            writerSuccessResult(initData, resp);
        } catch (Exception e) {
            String errorMsg = e.getMessage();
            writerErrorResult(errorMsg, resp);
        }

    }
}
